<template>
    <div>
        <input type="file" multiple @change="selectFiles">
        <!-- 使用multiple标签标记多文件上传 -->
        <button @click="uploadFile">上传</button>
    </div>
    <div>
        {{ File_Path.arr }}
    </div>
</template>

<script setup>

import { inject, reactive, ref } from 'vue';
import { epStore } from "../common/store.js";
import { storeToRefs } from "pinia";
import cfile from "../utils/UploadFiles.js"
import { router } from '../common/router';
const SparkMD5 = inject('SparkMD5')
const axios = inject('axios')


let File_Path = reactive({
    arr: []
})


// 获取文件 么问题
const selectFiles = (e) => {
    cfile.selectFilesForm(e)
}


// 上传文件 上传完毕后执行回调
const uploadFile = () => {
    cfile.uploadFile(() => {
        // 在每次上传了文件都会执行回调

        // 有待优化

        File_Path.arr.push(cfile.File_Path[0])
        cfile.user_files = []
    })
}


</script>

<style lang="scss" scoped>

</style>